Skip to content

Conversation

@TimPansino
Copy link
Contributor

Overview

  • Guard against crashes in Azure Functions Utilization
  • Add regression tests for this behavior

@TimPansino TimPansino requested a review from a team as a code owner December 19, 2025 21:23
@github-actions
Copy link

github-actions bot commented Dec 19, 2025

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 7 0 0 1.12s
✅ MARKDOWN markdownlint 7 0 0 0 1.39s
✅ PYTHON ruff 961 0 0 0 1.07s
✅ PYTHON ruff-format 961 0 0 0 0.5s
✅ YAML prettier 15 0 0 0 1.73s
✅ YAML v8r 15 0 0 5.17s
✅ YAML yamllint 15 0 0 0.65s

See detailed reports in MegaLinter artifacts

MegaLinter is graciously provided by OX Security

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 57.14286% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.69%. Comparing base (a7ade08) to head (54bf509).

Files with missing lines Patch % Lines
newrelic/common/utilization.py 60.00% 2 Missing and 2 partials ⚠️
newrelic/hooks/framework_azurefunctions.py 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1613      +/-   ##
==========================================
+ Coverage   81.65%   81.69%   +0.03%     
==========================================
  Files         209      209              
  Lines       24392    24387       -5     
  Branches     3870     3869       -1     
==========================================
+ Hits        19918    19923       +5     
+ Misses       3162     3153       -9     
+ Partials     1312     1311       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mergify mergify bot added tests-failing Tests failing in CI. and removed tests-failing Tests failing in CI. labels Dec 22, 2025
@mergify mergify bot added the tests-failing Tests failing in CI. label Dec 29, 2025
if website_owner_name and "+" in website_owner_name:
subscription_id = website_owner_name.split("+")[0] or "Unknown"

resource_group_name = os.environ.get("WEBSITE_RESOURCE_GROUP", "Unknown")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The biggest issue here is that the WEBSITE_RESOURCE_GROUP environment variable is not guaranteed to be present.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More specifically, it is not present in the Consumer plan and it is not always present in the Flex Consumer plan at the time we would need the value of this.



def test_utilization(monkeypatch):
monkeypatch.setenv("REGION_NAME", "EastUS2")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out this is case sensitive when being passed into the application: it should be all lowercase

Suggested change
monkeypatch.setenv("REGION_NAME", "EastUS2")
monkeypatch.setenv("REGION_NAME", "eastus2")

@mergify mergify bot removed the tests-failing Tests failing in CI. label Jan 8, 2026
@mergify mergify bot added the tests-failing Tests failing in CI. label Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests-failing Tests failing in CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants